package com.als.healthymananger.mapper;

import com.als.healthymananger.dto.AppointmentDto;
import com.als.healthymananger.entity.Appointment;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author aion
 * @since 2021-07-21
 */
@Mapper
public interface AppointmentsMapper extends BaseMapper<Appointment> {

    @Select("SELECT ap.id,  ap.`archives_id`, ap. DATE, ap.`type`, ap.`enable`, ar.username, ar.name, ar.identity, ar.phone, ar.nation, ar.marry FROM appointments AS ap, archives AS ar WHERE ap.id = ${id} AND ar.`id`=ap.`archives_id`")
    AppointmentDto getAppointmentById(@Param("id")Integer appointmentId);
}
